saveWebPage

abstract fun saveWebPage(htmlFilePath: Path, resourcesDir: Path, saveType: SavePageType): Boolean

Initiates the saving process of the currently loaded web page. The web page can be saved as a single HTML file or the file with resources. Before saving a web page make sure that it is not being loaded. It is recommended to completely loaded the web page and only then save it.

Return

true if the saving process has been initialized successfully

Parameters

htmlFilePath

an absolute path to a file in which the web page will be saved

resourcesDir

an absolute path to a directory in which the resources (e.g. images, css) of the web page will be saved. If the directory does not exist, it will be created

saveType

determines how the web page will be saved: as an HTML file with all the required resources (e.g. images, css etc.), a single HTML or MHTML file

Throws

when the browser is already closed